using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SmartLink.Domain.Entity;
using SmartLink.IRepository;
using SmartLink.Repository.Base;
using Dapper;

namespace SmartLink.Repository
{
    public class PER_MenuPermissionsRoleRepo : RepositoryBase<PER_MenuPermissionsRole>, IPER_MenuPermissionsRoleRepo
    {
        public IList<PER_MenuPermissionsRole> GetMenusByRole(int roleId)
        {
            IList<PER_MenuPermissionsRole> results = new List<PER_MenuPermissionsRole>();
            using (var conn = DapperHelper.GetDefaultConnection())
            {
                var sql = string.Format(" select * from PER_MenuPermissionsRole where RID=@RID");
                results = conn.Query<PER_MenuPermissionsRole>(sql, new { RID = roleId}).ToList();
            }
            return results;
        }
    }
}
